package day0814;

/**
 * @Author:galaxy_yan
 * @Date: 2022/8/15
 * @Time: 9:39
 * @Description
 * 作业标题(1706)
 * 数组所有元素之和
 */
public class text4 {
    public static void main(String[] args) {
        int[] arr={1,2,3,4,5,6,7,8,9};
        System.out.println(sum(arr));
    }

    private static int sum(int[] arr) {
        int sum=0;
        for (int i:arr) {
            sum+=i;
        }
        return sum;
    }
}
